package cn.xiaohuodui.dao;

import cn.xiaohuodui.form.good.SearchForm;
import cn.xiaohuodui.model.Category;
import cn.xiaohuodui.model.Good;
import cn.xiaohuodui.model.GoodWithBLOBs;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface GoodMapper {
    int deleteByPrimaryKey(Integer id);

    int count();

    int insert(GoodWithBLOBs record);

    int insertSelective(GoodWithBLOBs record);

    GoodWithBLOBs selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(GoodWithBLOBs record);

    List<Good> querySelective(Map map);

    List<Good> queryByCategory(@Param("cid") Integer cid,@Param("limit") Integer limit);

    int countSelective(Map map);

    int updateByPrimaryKeyWithBLOBs(GoodWithBLOBs record);

    int updateByPrimaryKey(Good record);

    List<Good> getIndexNewGoods(int limit);


    List<Good> getIndexHotGoods(int limit);

    //获得首页某类目下的推荐商品
    List<Good> getCategoryGoods(int category);




    /**
     * 后台过滤查询预约订单
     *
     * @param qm
     * @return
     */
    int goodBackCount(Map qm);

    List<Good> goodBackQuery(Map qm);
}